# Recode Variables

data <- data[,-c(3,4)]
data <- data[ , -c(26, 28)]

# Demographics
data$fem <- ifelse(data$E730==1, 0, 1)
data$age <- data$E731

data$leftright  <- as.numeric(data$leftright)

# Should be allowed to vote
data$rel_vote <- as.numeric(data$rel_vote)*-1 + 6

# public office
data$rel_office <- as.numeric(data$rel_office)*-1 + 6

# Attitude toward Ban/Permit
data$liberal <- as.numeric(data$rel_posban)
data$liberal.2 <- as.numeric(data$rel_posper)*-1 + 6
data$liberal <- ifelse(is.na(data$liberal)==T, data$liberal.2, data$liberal)

data$permission <- ifelse(data$rel_banperm=="Authorities propose to permit", 1, 0)

data$rel_dev <- ifelse(data$rel_devotion==1, 1, 0)
data$rel_rad <- ifelse(data$rel_devotion==3, 1, 0)

data$bulg <- ifelse(data$rel_country=="immigrants from Bulgaria", 1, 0)
data$nig <- ifelse(data$rel_country=="immigrants from Nigeria", 1, 0)

data$rel_immigrant <- ifelse(data$rel_britain==1, 0, 1)

# It is important to always behave properly. 
# You want to avoid doing anything people would say is wrong.
data$behave <- ifelse(data$E611==-99, NA, data$E611)

# It is important that the government ensures the county???s safety 
# against all threats. 
# The state should be strong so it can defend its citizens.
data$safety <- ifelse(data$E612==-99, NA, data$E612)

# People should do what they're told. People should follow rules at all times,
# even when no-one is watching.
data$told <- ifelse(data$E613==-99, NA, data$E613)

# Restrict Sample 
data <- data[data$ethn_brit==1, ]


